/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.maistre.swarn;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Louis Maistre
 */
public class Environement {
    
    ListRessources avalaibleRessources = new ListRessources();
    List<Entity> entitys = new ArrayList<>();

    public Environement(ListRessources ressourceses) {
        this.avalaibleRessources.addAll(ressourceses);
    }

    public void addEntity(MitoseEntity entity) {
        this.entitys.add(entity);
    }

   public ListRessources getAvalaibleRessources(Entity entity) {
	   ListRessources ressources = new ListRessources();
	   ressources.add(new Ressource(RessourceNames.Energie, 3));
	   ressources.add(new Ressource(RessourceNames.Vitalité, 1));
        return ressources;
    }
   
   public void getRessource(Entity entity,Ressource ressource){
	   if(this.avalaibleRessources.contains(ressource)){
		  this.avalaibleRessources.remove(ressource);
		  entity.addRessource(ressource);
		   
	   }
   }

public void getRessources(Entity entity, ListRessources ressources) {
	for (Ressource ressource : ressources) {
		this.getRessource(entity, ressource);
	}
	
}
    
    
}
